package com.atmilan.quartz.job;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.stereotype.Component;

import com.atmilan.quartz.service.IJkyContrastService;

/**
 * 往第三方下游推送商品
 * @Description: 
 * @author daigb
 * @date 2021-02-01
 */
@Component
@Configuration
@EnableScheduling
public class TmallTask {
	@Autowired
    BaseTask baseTask;
    @Autowired
    IJkyContrastService tianMaoService;
    
    /**
     * 推送给天猫商品
     */
    /*@Scheduled(cron = "0 30 5/4 * * ?")
    public void tmallTask() {
        if(!tmallProductStatus) {
            log.warn("--------------- 推送给天猫商品标识为不执行 ---------------");
            return;
        }
    
        log.warn("--------------- 开始推送给天猫商品任务 ---------------");
        service.execute(() -> {
            try {
                tianMaoService.pushProduct();
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
    }*/

    /**
     * 拉取天猫订单并推送
     */
    /*@Scheduled(fixedDelay = 1000 * 60 * 5)
    public void orderTask() {
        if(!tmallOrderStatus) {
            log.warn("--------------- 推送给天猫订单标识为不执行 ---------------");
            return;
        }
        service.execute(() -> {
            try {
                tianMaoService.pullOrder();
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
    }*/

}
